from django.contrib import admin
from blog import models

class AuthorAdmin(admin.ModelAdmin):
    list_display=('name','email','website')
    search_fields=('name',)

class BlogAdmin(admin.ModelAdmin):
    list_display=('caption','author','publish_time')
    list_filter=('publish_time',)
    date_hierarchy='publish_time'
    ordering=('-publish_time',)
    filter_horizontal=('tags',)

admin.site.register(models.Author,AuthorAdmin)
admin.site.register(models.Blog,BlogAdmin)
admin.site.register(models.Tag)